package com.nulldev.util.concurrency.threadIt.v4.emapi.testing;

import com.nulldev.util.JVM.JVM;
import com.nulldev.util.VariableAPI.StringsUtil;
import com.nulldev.util.concurrency.threadIt.v4.emapi.ExecutorManager;
import com.nulldev.util.concurrency.threadIt.v4.emapi.uft.Executable;
import com.nulldev.util.languages.json.uniapi.UniJsonValue;

public class JumboGarbageJSONTest {

	public static void main(String[] args) {
		JVM.println("Generating 16MB of garbage data...");
		final String GARBAGE = StringsUtil.randomStringAlphabet(16 * 1024 * 1024);
		JVM.println("Done.");

		final Executable<UniJsonValue> task2 = ExecutorManager.globalSubmit(() -> {
			return UniJsonValue.parse("{".concat(GARBAGE).concat("}"));
		});

		ExecutorManager.globalAsyncSubmit(() -> {
			return task2.waitTillCompletion();
		}).waitTillCompletion();

	}
}
